\chapter{Theoretical Study of technologies}

The previous chapters gave a detailed overview of the problems arising from the required automation process in the DAS-4 data plane and optical mesh networks alike. This chapter gives an overview of applicable technologies and explores their implementational characteristics.


\section{Routing}

The lightpath allocation process in DAS-4 provides a way of dynamically reconfiguring network paths. Such changes may result in a variety of network configurations causing previously neighboring nodes to be placed on alternate point-to-point paths with a new neighbor that uses different logical addresses. Although such a problem can be solved by extending currently used scripts that provide IP addressing and static routes, complete automation can be achieved by using a routing protocol. The main purpose of a routing protocol is to disseminate network prefixes and exchange state information between network nodes. Although routing alone does not solve the discussed neighbor reconfiguration problem, it does facilitate a more robust and self-contained methodology of disseminating network prefixes and routing traffic.

\subsection{OSPF}

Open Shorted Path First is a link-state routing protocol. Building upon the shortcomings of RIP (TODO ref), it facilitates faster link failure detection in addition to less bandwidth-intensive topology information dissemination. In contrast to RIP, which uses update messages to both exchange topology information as well as a pulse for detecting neighbors, OSPF provides a special type of message, called Update, for detecting link failures. Lightpath reallocations in DAS-4, which may result in nodes facing neighbors on different subnets can be considered as a link failure from the perspective of OSPF. Detecting such failures with OSPF provides a distinctive advantage because the protocol carries its messages directly over IP (as opposed to TCP or UDP). Another important characteristic of OSPF is that the interval used for sending hello messages can be much more aggressive than in RIP. These qualities make the use of OSPF highly advantageous in optical networks that experience a high amount of reconfigurations in small time intervals. 

\section{Capacity provisioning}

The process of capacity provisioning, or increasing available bandwidth, can be approached in various ways. From the physical perspective, capacity provisioning is closely related to either changing currently existing network interfaces with ones that support a higher speed or by introducing additional interfaces. As the design of the DAS-4 network is pushing close to the limit of current network media, the latter approach is used.


TODO:
technologies capable of load-balancing across at least 4 interfaces.

\subsection{Layer 2 link aggregation}

Link aggregation on Layer 2 is the process of combining multiple network connections into one with the purpose of providing fail-over in case a network path fails and increasing overall bandwidth above the limit provided by an individual connection. Various implementations exist with the most prominent one being IEEE 802.3ad. This standard provides link aggregation at Layer 2 with the following characteristics:

\begin{itemize}
    \item Bundles multiple interfaces into a single logical one
    \item The individual MAC addresses of interfaces are changed with a single new MAC mapped to the logical interface
    \item Creates aggregation groups that share the same speed and duplex settings
    \item Traffic is distributed equally across the individual by link following a particular hashing policy with built-in out-of-order packet prevention
\end{itemize}



TODO:
    - when best used? (all links in bundle at same speed, always between two endpoints, all TCP info retained, statistically no complications on points mentioned for ECMP)
    
    
\subsection{Multi-homing Transport Layer protocols}

TODO: freebsd

\subsection{OSPF load balancing}

Routing protocols such as OSPF (in addition to RIP) provide support for load-balancing. An integral structure of the protocol is its Link-State Database (LSDB). In it's essence, the LSDB is a discrete representation in the form of a table containing all path part of the network. Each table entry provides a cost, an next-hop and a network prefix. An important quality of the OSPF protocol is the support of associating multiple next-hops towards a prefix in its LSDB. This feature provides the foundations of Equal-Cost Multi-Path (ECMP) routing for Operating Systems (OS). The OSPF protocol aids systems in learning multiple routes towards a destination and installing them in the system's routing table. Then, by relying on certain traffic forwarding mechanisms such as flow-based and packet-switched, an OS is capable of load-balancing traffic towards a destination across multiple paths. Just as LACP, ECMP provides failure-resilience in addition to avoiding congestion by increasing available bandwidth, however, some subtle problems are created: 

\begin{itemize}
    \item In the case of fragmentation, Transport-Layer information may not be available in every packet
    \item Traffic may be load-balanced across paths with different bandwidth, loss and MTU settings resulting in packet reordering
\end{itemize}

However, within the scope of the DAS-4 network, these concerns do not play a crucial role because:

\begin{itemize}
    \item All links are using the same type of media
    \item All links share the same speed and MTU settings
    \item Multi-paths towards a prefix are always constructed between two endpoints rather than passing via a third one 
\end{itemize}


TODO: actual working of the implementation on linux: multiple routing tables, one per interface. iproute2, kernel build flags, module present.

TODO: u12.04,deb wheezy, fedore 19 either load balance on both link, but at the speed of one, or with deb and fedora just over one. freebds load balances as expected when multiple hops towards a predix exist in iptables2 
